package com.woniu.order.controller;

import com.woniu.common.utils.ResponseData;
import com.woniu.order.service.OrderDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ltyipx
 * @version 1.0
 * @description:TODO
 * @date 2024/8/10 14:35
 */
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class OrderDetailController {
    @Autowired
    private OrderDetailService orderDetailService;
    @GetMapping("/queryOrderDetailByOrderId")
    public ResponseData<?> queryOrderDetailByOrderId(String orderId){
        return orderDetailService.queryOrderDetailByOrderId(orderId);
    }
    @PostMapping("/queryInvoice")
    public ResponseData<?> queryInvoice(@RequestBody String orderId){
        String substring = orderId.substring(0, orderId.length() - 1);

        return orderDetailService.queryInvoice(substring);
    }
    @GetMapping("queryOrderDetailTypeNumber")
    public ResponseData<?> queryOrderDetailTypeNumber(){
        return orderDetailService.queryOrderDetailTypeNumber();
    }

    @GetMapping("/payOrderDetailNumber")
    public ResponseData<?> payOrderDetailNumber(){
        return orderDetailService.payOrderDetailNumber();
    }
}
